package cn.tedu.sp04.feign;

import cn.tedu.sp01.pojo.User;
import cn.tedu.sp01.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(name = "user-service", fallback = UserFeignClientFB.class)
public interface UserFeignClient {

    @GetMapping("/{userId}")
    public JsonResult<User> getUser(@PathVariable(value = "userId") Integer userId);


    @GetMapping("/{userId}/score")
    public JsonResult<?> addScore(@PathVariable(value = "userId") Integer userId, Integer score);
}
